<%--
  Created by IntelliJ IDEA.
  User: luojie
  Date: 2018/6/11
  Time: 10:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page contentType="application/msexcel" %>
<!-- 以上这行设定本网页为excel格式的网页 -->
<%
    response.setHeader("Content-disposition","inline; filename=test1.xls");
    /*    下载的方式： response.setHeader("Content-disposition","attachment; filename=test2.xls");  */
    //以上这行设定传送到前端浏览器时的档名为test1.xls
    //就是靠这一行，让前端浏览器以为接收到一个excel档
%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <base href="<%=basePath%>"/>

        <title>My JSP 'test.jsp' starting page</title>

        <meta http-equiv="pragma" content="no-cache"/>
        <meta http-equiv="cache-control" content="no-cache"/>
        <meta http-equiv="expires" content="0"/>
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
        <meta http-equiv="description" content="This is my page"/>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
        <link rel="stylesheet" href="<%=basePath%>../css/index.css"/>
        <title>Excel档案呈现方式</title>
    </head>

    <table border="1">
        <tr>
            <td>序号</td>
            <td>业务状态</td>
            <td>客户名称</td>
            <td>业务类别</td>
            <td>金额（万元）</td>
            <td>销售负责人</td>
            <td>简要说明</td>
            <td>工作目标要点</td>
            <td>工作绩效目标（A）</td>
        </tr>
        <c:forEach items="${list.data}" var="v" >
            <tr class="tr">
                <td >${v.id}</td>
                <td>${v.status}</td>
                <td >${v.sname}</td>
                <td >${v.stype}</td>
                <td >${v.money}</td>
                <td style="width:16%;height:30%">${v.sleader}</td>
                <td >${v.content}</td>
                <td >${v.point}</td>
                <td id="leader">${v.target}</td>
            </tr>
        </c:forEach>
    </table>

</html>

